package cn.net.shuxing.yifu.common.service;

import cn.net.shuxing.yifu.common.bean.BaseArea;
import cn.net.shuxing.yifu.common.mapper.BaseAreaMapper;
import cn.net.shuxing.yifu.common.util.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BaseAreaService {


    @Autowired
    BaseAreaMapper baseAreaMapper;


    public List<BaseArea> getProvinceList(){
        List<BaseArea> areaList = baseAreaMapper.selectProvinceList();
        return areaList;
    }

    public List<BaseArea> getCityList(Integer provinceId){
        List<BaseArea> areaList = baseAreaMapper.selectCityList(provinceId);
        return areaList;
    }

    public List<BaseArea> getDistrictList(Integer cityId){
        List<BaseArea> areaList = baseAreaMapper.selectDistrictList(cityId);
        return areaList;
    }

    public BaseArea selectAreaById(Integer id){
        BaseArea baseArea = baseAreaMapper.selectAreaById(id);
        return baseArea;
    }



}
